/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canteen.sys.model.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;

/**
 *
 * @author TNT
 */
@Entity
public class BillDetail implements Serializable {

    @Id
    @ManyToOne
    @JoinColumn(name = "bId")
    private BillMaster bill;
    @Id
    @ManyToOne
    @JoinColumn(name = "itemId")
    private ItemMaster item;
    @NotNull
    private int itemSrNo;
   
    private int itemQty;
    @NotNull
    private double itemRate;

    public BillDetail() {
    }

    public BillDetail(BillMaster bill, ItemMaster item, int itemSrNo, int itemQty, double itemRate) {
        this.bill = bill;
        this.item = item;
        this.itemSrNo = itemSrNo;
        this.itemQty = itemQty;
        this.itemRate = itemRate;
    }

    public BillMaster getBill() {
        return bill;
    }

    public void setBill(BillMaster bill) {
        this.bill = bill;
    }

    public ItemMaster getItem() {
        return item;
    }

    public void setItem(ItemMaster item) {
        this.item = item;
    }

    public int getItemSrNo() {
        return itemSrNo;
    }

    public void setItemSrNo(int itemSrNo) {
        this.itemSrNo = itemSrNo;
    }

    public int getItemQty() {
        return itemQty;
    }

    public void setItemQty(int itemQty) {
        this.itemQty = itemQty;
    }

    public double getItemRate() {
        return itemRate;
    }

    public void setItemRate(double itemRate) {
        this.itemRate = itemRate;
    }
}
